package gui.mainFrame.testCreator.parameterEditor;

import gui.GUIController;
import java.awt.Dimension;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
import javax.swing.border.TitledBorder;

/**
 *
 * @author William Whitney
 */
public class ParamTable extends JScrollPane
{
    private static final long serialVersionUID = 1L;

    private JTable table;
    private final ParamTableModel model;

    public ParamTable(GUIController guiController, ParamTableModel paramModel)
    {
        this.model = paramModel;

        //Setup Scroll Panel
        TitledBorder border = new TitledBorder("Parameter Information");
        this.setBorder(border);
        this.setPreferredSize(new Dimension(300, 100));
        this.setMinimumSize(new Dimension(0, 0));

        //Setup Table
        this.table = new JTable(this.model);
        this.table.getTableHeader().setReorderingAllowed(false);
        this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

        //Add Table
        this.setViewportView(this.table);
    }
}
